package cn.kgc.form;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;

import java.util.Date;

/**
 * @author wangyue
 * @version 1.0
 */
@Data
@ApiModel(value = "查询待审批企业信息")
public class CompanyQueryForm {
    @ApiModelProperty(value ="公司名称" )
    private String companyName;

    @ApiModelProperty(value ="申请人姓名" )
    private String commitName;

    @ApiModelProperty(value ="申请开始时间" )
    private String startTime;

    @ApiModelProperty(name = "endTime",value = "申请的结束时间")
    private String endTime;

    @ApiModelProperty(value = "审核状态")
    private int reviewStatus;

    @ApiModelProperty(value = "当前页数")
    private int pageIndex;

    @ApiModelProperty(value = "每页显示条数")
    private int pageSize;

    @Setter(value = AccessLevel.NONE)
    private Date startDateTime;

    public Date getStartDateTime() {
       return StrUtil.isBlank(startTime) ? null : DateUtil.parse(startTime,"yyyy-MM-dd");
    }

    @Setter(value = AccessLevel.NONE)
    private Date endDateTime;

    public Date getEndDateTime() {
        return StrUtil.isBlank(endTime) ? null : DateUtil.parse(endTime,"yyyy-MM-dd");
    }
}
